from langchain_huggingface import HuggingFaceEmbeddings

embedding_model = HuggingFaceEmbeddings(
    model_name="all-MiniLM-L6-v2",  # 模型名称
    model_kwargs={"device": "cpu"},  # 设备
    encode_kwargs={"normalize_embedding": True},  # 归一化
)
print(embedding_model)
